#include <bits/stdc++.h>

using namespace std;

void solve() {
	int x, y, z;
	cin >> x >> y >> z;
	bool ans = true;
	for (int i = 0; i < 31; i++)
	{
		int xi = (x >> i) & 1;
		int yi = (y >> i) & 1;
		int zi = (z >> i) & 1;

		if (!(
			(xi == 0 && yi == 0 && zi == 0)
			|| (xi == 0 && yi == 0 && zi == 1)
			|| (xi == 1 && yi == 0 && zi == 0)
			|| (xi == 0 && yi == 1 && zi == 0)
			|| (xi == 1 && yi == 1 && zi == 1)
			))
		{
			ans = false;
			break;
		}
	}
	cout << (ans ? "YES" : "NO") << endl;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int t;
	cin >> t;
	while (t-- > 0) {
		solve();
	}
	return 0;
}
